package com.haojin.contacs;

public class MaoPaoTest {
public static void main(String[] args){
	int arr[] = new int[]{0,-11,555,29,-98,99,24,29,28,-112,-11,0};
	for(int i = 0;i<arr.length-1;i++){
		for(int j = 0;j<arr.length-1-i;j++){
			if(arr[j]>arr[j+1]){
				int tmp = arr[j];
				arr[j] = arr[j+1];
				arr[j+1] = tmp;
			}
		}
	}
		for(int i = 0;i<arr.length;i++){
		System.out.print(arr[i]+"\t");}
		for(int j = 0;j<arr.length;j++){
			if(j < arr.length/2){
				int tmp = arr[j];
				arr[j] = arr[arr.length-j-1];
				arr[arr.length-j-1] = tmp;
			}
			
		}
		System.out.println();
			for(int i = 0;i<arr.length;i++){
				System.out.print(arr[i]+"\t");}
}
}
